package sg.edu.nus.dbd.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ResourceBundle;

/**
 * 
 * @author Ashok Savarimuthu, Felix Halim
 * 
 */
public class ConnectionUtil {

	public static Connection getConnection() {
		Connection connection = null;
		try {
			ResourceBundle bundle = ResourceBundle.getBundle("connection");
			Class.forName(bundle.getString("driver"));
			connection = DriverManager.getConnection(bundle.getString("url"),
					bundle.getString("user"), bundle.getString("password"));
		} catch (ClassNotFoundException e) {
			MyLogger.debug("JDBC Driver Error: " + e);
		} catch (SQLException e) {
			MyLogger.debug("DB Connection Error: " + e);
		}
		return connection;
	}
}
